﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Collections.ObjectModel;

namespace produccion.modelo
{
    public class MMontajeaDespachos : ObservableObject
    {
        MDOgeneral _mod = new MDOgeneral();

        #region Metodos
        public List<MMontajeaDespachos.resumen> listarresumen()
        {
            try
            {
                string query = "select lote_lpn, fecha_lpn, sum(canpro_lpn) as total from lectpend where estado_lpn = 'P' and tipo_lpn = 'MD' group by lote_lpn, fecha_lpn order by lote_lpn desc ";
                DataTable val = _mod.consulta(query);

                List<MMontajeaDespachos.resumen> lisres = new List<MMontajeaDespachos.resumen>();
                foreach (DataRow r in val.Rows)
                {
                    lisres.Add(new MMontajeaDespachos.resumen
                    {
                        numLote = Convert.ToInt32(r["LOTE_LPN"]),
                        dtmFecha = Convert.ToDateTime(r["FECHA_LPN"]).Date,
                        numTotal = Convert.ToInt32(r["TOTAL"])
                    });
                }
                return lisres;
            }
            catch (Exception e) { throw e; }
        }
        #endregion

        public class resumen : ObservableObject
        {

            #region Propiedades
            private Int32 _numLote;
            public Int32 numLote
            {
                get { return _numLote; }
                set { _numLote = value; }
            }

            private DateTime _dtmFecha;
            public DateTime dtmFecha
            {
                get { return _dtmFecha; }
                set { _dtmFecha = value; }
            }

            private Int32 _numTotal;
            public Int32 numTotal
            {
                get { return _numTotal; }
                set { _numTotal = value; }
            }

            private string _strNumeroOrden;
            public string strNumeroOrden
            {
                get { return _strNumeroOrden; }
                set { _strNumeroOrden = value; }
            }

            #endregion

        }

        public class detalle : ObservableObject
        {

            #region Propiedades
            private string _strOrden;
            public string strOrden
            {
                get { return _strOrden; }
                set { _strOrden = value; }
            }

            private string _strCodigo;
            public string strCodigo
            {
                get { return _strCodigo; }
                set { _strCodigo = value; }
            }

            private string _strDescripcion;
            public string strDescripcion
            {
                get { return _strDescripcion; }
                set { _strDescripcion = value; }
            }

            private string _strColor;
            public string strColor
            {
                get { return _strColor; }
                set { _strColor = value; }
            }

            private string _strNombreColor;
            public string strNombreColor
            {
                get { return _strNombreColor; }
                set { _strNombreColor = value; }
            }

            private string _strTalla;
            public string strTalla
            {
                get { return _strTalla; }
                set { _strTalla = value; }
            }

            private Int32 _T1;
            public Int32 T1
            {
                get { return _T1; }
                set { _T1 = value; }
            }

            private Int32 _T2;
            public Int32 T2
            {
                get { return _T2; }
                set { _T2 = value; }
            }

            private Int32 _T3;
            public Int32 T3
            {
                get { return _T3; }
                set { _T3 = value; }
            }

            private Int32 _T4;
            public Int32 T4
            {
                get { return _T4; }
                set { _T4 = value; }
            }

            private Int32 _T5;
            public Int32 T5
            {
                get { return _T5; }
                set { _T5 = value; }
            }

            private Int32 _T6;
            public Int32 T6
            {
                get { return _T6; }
                set { _T6 = value; }
            }

            private Int32 _T7;
            public Int32 T7
            {
                get { return _T7; }
                set { _T7 = value; }
            }

            private Int32 _T8;
            public Int32 T8
            {
                get { return _T8; }
                set { _T8 = value; }
            }

            private Int32 _T9;
            public Int32 T9
            {
                get { return _T9; }
                set { _T9 = value; }
            }

            private Int32 _T10;
            public Int32 T10
            {
                get { return _T10; }
                set { _T10 = value; }
            }

            private Int32 _T11;
            public Int32 T11
            {
                get { return _T11; }
                set { _T11 = value; }
            }

            private Int32 _T12;
            public Int32 T12
            {
                get { return _T12; }
                set { _T12 = value; }
            }

            private Int32 _T13;
            public Int32 T13
            {
                get { return _T13; }
                set { _T13 = value; }
            }

            private Int32 _T14;
            public Int32 T14
            {
                get { return _T14; }
                set { _T14 = value; }
            }

            private Int32 _T15;
            public Int32 T15
            {
                get { return _T15; }
                set { _T15 = value; }
            }

            private Int32 _T16;
            public Int32 T16
            {
                get { return _T16; }
                set { _T16 = value; }
            }

            private Int32 _T17;
            public Int32 T17
            {
                get { return _T17; }
                set { _T17 = value; }
            }

            private Int32 _T18;
            public Int32 T18
            {
                get { return _T18; }
                set { _T18 = value; }
            }

            private Int32 _T19;
            public Int32 T19
            {
                get { return _T19; }
                set { _T19 = value; }
            }

            private Int32 _T20;
            public Int32 T20
            {
                get { return _T20; }
                set { _T20 = value; }
            }

            private Int32 _numTotal;
            public Int32 numTotal
            {
                get { return _numTotal; }
                set { _numTotal = value; }
            }
            #endregion

        }
    }
}
